<?PHP
class appEnglish extends appControl
{
	protected $tagName = 'table';
	
	public function appEnglish($dataList=array())
	{
		parent::appControl($dataList);
	}
	public function OnInit($sender, $data)
	{
		if (empty($dataList))
		{
			$db = dict::get();
			$dataList = $db->English->table();
		}		
		foreach ( $dataList as $item )
		{
			$tr = new tagTr(array('itemid'=>$item->id));
			
			$data = "{id:'{$item->id}', word:'{$item->word}',description:'{$item->description}'}";

			$td = new tagTd();
			$tagText = new htmlText($item->word);
			$tagA = new tagA(array('href' => 'javascript:void(0);', 'onclick'=>"menu.showDialog('editWord', $data);"));
			$tagA->addControl($tagText);
			$td->addControl($tagA);
			$tr->addControl($td);
			
			$td = new tagTd();
			$tagText = new htmlText($item->description);
			$td->addControl($tagText);
			$tr->addControl($td);

			$this->addControl($tr);
		}
	}
}
?>